package Controller.Chart;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.ChartDao;

public class DejunChartContoller implements Controller{
	private ChartDao dao;
	
	public void setDao(ChartDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("대전 차크 게시판");
		
		int ka_no = dao.dejunSequence();
		System.out.println("대전 시퀀스 값 : " + ka_no);
		
		List<joinHadoopBean> dejunlist = dao.dejunChartList(ka_no);
		for (joinHadoopBean joinHadoopBean : dejunlist) {
			System.out.println("카운터 값 : "+joinHadoopBean.getArealikebean().getA_count());
			System.out.println("제목 : "+joinHadoopBean.getMusicbean().getMs_title());
		}
		ModelAndView mav = new ModelAndView();
		mav.setViewName("dejunChart");
		mav.addObject("dejunchart", dejunlist);
		return mav;
	}
}
